package com.thread.www;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author 新技术软件：汪洋
 */
public class Singleton3 {
    private static Singleton3 instance;
    private static ReentrantLock lock = new ReentrantLock();
    private Singleton3(){}
    public static Singleton3 getInstance(){
        if(instance == null){
            lock.lock();
            if(instance == null){
                instance = new Singleton3();
            }
            lock.unlock();
        }
        return instance;
    }
}
